package com.wei.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wei.dto.KeyValueDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @author 蔡徐坤
 * @since 2025-07-28
 */
@Data
@TableName("product")
@Schema(name = "ProductDO", description = "产品表")
public class ProductDO implements Serializable {

    @Schema(description = "产品ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "产品名称")
    @TableField("name")
    private String name;

    @Schema(description = "品牌ID")
    @TableField("brand_id")
    private Long BrandId;

    @Schema(description = "")
    @TableField("main_image")
    private String mainImage;

    @Schema(description = "图集(用','隔开)")
    @TableField("atlas")
    private String atlas;

    @Schema(description = "是否有货（0无 1有）")
    @TableField("has_stock")
    private Boolean hasStock;

    @Schema(description = "原价(单位：分)")
    @TableField("price")
    private Long price;

    @Schema(description = "折扣价(单位：分）")
    @TableField("new_price")
    private Long newPrice;

    @Schema(description = "折扣")
    @TableField("off_percent")
    private Double offPercent;

    @Schema(description = "商品描述")
    @TableField("summary")
    private String summary;

    @Schema(description = "详细描述")
    @TableField("description")
    private String description;

    @Schema(description = "其他信息(key-value键值对)")
    @TableField("additional_info")
    private String additionalInfo;

    @Schema(description = "创建时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private Date createTime;

    @Schema(description = "修改时间")
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    private Date updateTime;

    /** 评分 */
    @TableField(exist = false)
    private Double rating;

    /** 分类 */
    @TableField(exist = false)
    private List<String> categories;
    /** 标签 */
    @TableField(exist = false)
    private List<String> tags;

    /** 分类 */
    @TableField(exist = false)
    private Long categoryIds;
    /** 标签 */
    @TableField(exist = false)
    private List<Long> tagIds;

    /** 更多信息 */
    @TableField(exist = false)
    private List<KeyValueDTO> additionalInfoList;
}
